package com.ycrlkj.android.modulescore.main.viewmodel;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class LoginViewModel extends ViewModel {

    public MutableLiveData<Boolean> agree; //同意协议
    public MutableLiveData<Integer> loginType; //登录方式: 1=>密码登录, 2=>验证码登录
    public MutableLiveData<String> phone;
    public MutableLiveData<String> passwordOrSmsCode;

    public MutableLiveData<Integer> sendSmsCodeWait; //发送验证码间隔等待

    public MutableLiveData<Boolean> getAgree() {
        if(agree == null){
            agree = new MutableLiveData<>();
            agree.setValue(false);
        }
        return agree;
    }

    public MutableLiveData<Integer> getLoginType() {
        if(loginType == null){
            loginType = new MutableLiveData<>();
            loginType.setValue(1);
        }
        return loginType;
    }

    public MutableLiveData<String> getPhone() {
        if(phone == null){
            phone = new MutableLiveData<>();
            phone.setValue("");
        }
        return phone;
    }

    public MutableLiveData<String> getPasswordOrSmsCode() {
        if(passwordOrSmsCode == null){
            passwordOrSmsCode = new MutableLiveData<>();
            passwordOrSmsCode.setValue("");
        }
        return passwordOrSmsCode;
    }


    public MutableLiveData<Integer> getSendSmsCodeWait() {
        if(sendSmsCodeWait == null){
            sendSmsCodeWait = new MutableLiveData<>();
            sendSmsCodeWait.setValue(60);
        }
        return sendSmsCodeWait;
    }

}
